package com.appleyk.controller;

import com.appleyk.model.User;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p></p>
 *
 * @author Appleyk
 * @version v1.0
 * @blob https://blog.csdn.net/appleyk
 * @github https://github.com/kobeyk
 * @date created on 2023/3/18:23:34
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("query")
    public ResponseEntity query(){
        List<User> users = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            users.add(new User((i+1),"test-"+(i+1)));
        }
        return ResponseEntity.ok(users);
    }

}
